﻿@model IEnumerable<handvn.Models.KeyWord>

@{
    ViewBag.Title = "Index";
}
@if (Request.IsAuthenticated && @Session["LoaiTaiKhoan"]!=null)
{
    if( @Session["LoaiTaiKhoan"].ToString() == "admin")
    {
<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            TenTuKhoa
        </th>
        <th>
            SoLuotTim
        </th>
        <th>
            TinhTrang
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.TenTuKhoa)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.SoLuotTim)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.TinhTrang)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.KeyWordID }) |
            @Html.ActionLink("Details", "Details", new { id=item.KeyWordID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.KeyWordID })
        </td>
    </tr>
}

</table>
}
}
else
{
    <p>
        Xin vui lòng đăng nhập</p>
    <script type="text/javascript">
        window.location.href = "http://handvn.com/Account/Admin"
    </script>
}